package mrms.api.entity;

import javax.persistence.*;
import java.util.Objects;

@Entity
@Table(name = "meetingmember", schema = "mrms", catalog = "")
@IdClass(MeetingmemberEntityPK.class)
public class MeetingmemberEntity {
    private int mid;
    private String uid;
    private Integer joined;
    private Long signtime;

    @Transient
    public UserEntity getUserDetail() {
        return userDetail;
    }

    public void setUserDetail(UserEntity userDetail) {
        this.userDetail = userDetail;
    }

    private UserEntity userDetail;

    @Id
    @Column(name = "mid")
    public int getMid() {
        return mid;
    }

    public void setMid(int mid) {
        this.mid = mid;
    }

    @Id
    @Column(name = "uid")
    public String getUid() {
        return uid;
    }

    public void setUid(String uid) {
        this.uid = uid;
    }

    @Basic
    @Column(name = "joined")
    public Integer getJoined() {
        return joined;
    }

    public void setJoined(Integer joined) {
        this.joined = joined;
    }

    @Basic
    @Column(name = "signtime")
    public Long getSigntime() {
        return signtime;
    }

    public void setSigntime(Long signtime) {
        this.signtime = signtime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        MeetingmemberEntity that = (MeetingmemberEntity) o;
        return mid == that.mid &&
                Objects.equals(uid, that.uid) &&
                Objects.equals(joined, that.joined) &&
                Objects.equals(signtime, that.signtime);
    }

    @Override
    public int hashCode() {

        return Objects.hash(mid, uid, joined, signtime);
    }
}
